import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String a = in.nextLine();
            String b = in.nextLine();

            findBrokenKey(a, b);
        }
    }

    public static void findBrokenKey(String str1, String str2) {
        HashSet<Character> set = new HashSet<>();

        str1 = str1.toUpperCase();
        str2 = str2.toUpperCase();

        for (int i = 0; i < str2.length(); i++) {
            set.add(str2.charAt(i));
        }

        HashSet<Character> set2 = new HashSet<>();

        for (int i = 0; i < str1.length(); i++) {
            if (!set.contains(str1.charAt(i)) && !set2.contains(str1.charAt(i))) {
                set2.add(str1.charAt(i));
                System.out.print(str1.charAt(i));
            }
        }

//        for (char ch : set2) {
//            System.out.print(ch);
//        }

//        Iterator<Character> it = set2.iterator();
//
//        while (it.hasNext()) {
//            System.out.print(it.next());
//        }
    }
}
